using System;
using MonoTouch.Foundation;

namespace SigTweet
{
	public static class Configuration
	{
		public static string AccountUserName {
			get {
				_accountUserName = NSUserDefaults.StandardUserDefaults.StringForKey (ACCT_USERNAME_CFG_KEY);
				
				if (String.IsNullOrEmpty (_accountUserName))
					throw new ApplicationException ("Account user name not configured; unable to proceed.");
				
				return _accountUserName;
			}
		}

		public static string AccountPassword {
			get {
				_accountPassword = NSUserDefaults.StandardUserDefaults.StringForKey (ACCT_PASSWORD_CFG_KEY);
				
				if (String.IsNullOrEmpty (_accountPassword))
					throw new ApplicationException ("Account password not configured; unable to proceed.");
				
				return _accountPassword;
			}
		}

		private const string ACCT_USERNAME_CFG_KEY = "userName";
		private const string ACCT_PASSWORD_CFG_KEY = "password";

		private static string _accountUserName;
		private static string _accountPassword;
	}
}
